﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProductionManagement.Infrstructre
{
    /// <summary>
    /// 生产管理仓储接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IRepository<T> where T : class, new()
    {
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        Task<ISugarQueryable<T>> GetAll();
        /// <summary>
        /// 不使用异步 显示
        /// </summary>
        /// <returns></returns>
        List<T> Query();
        /// <summary>
        /// 添加方法
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> AddAsync(T entity);
        /// <summary>
        /// 修改方法
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> UpdAsync(T entity);
        /// <summary>
        /// 批量真删除
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        Task<int> DelRange(List<T> entities);










    }
}
